package com.fjl;

import org.apache.tika.Tika;
import org.apache.tika.exception.TikaException;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.IOException;

@Service
public class FileParserService {
    private final Tika tika = new Tika();

    public String parseFile(String filePath) throws IOException, TikaException {
        return tika.parseToString(new File(filePath));
    }
}
